package com.lzw.breezeNovel.webApp.controller.novel;

import com.lzw.breezeNovel.common.result.Result;
import com.lzw.breezeNovel.webApp.service.novel.RecommenService;
import com.lzw.breezeNovel.webApp.vo.novel.BookVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 清风明月
 * @Package com.lzw.breezeNovel.webApp.controller
 * @date 2025/3/6
 * @description 基于协同过滤算法实现小说的推荐
 */
@RestController
@RequestMapping("/app/recommen")
@SuppressWarnings("all")
public class RecommenController {

    @Autowired
    private RecommenService recService;

    /**
     * 基于协同过滤算法对小说进行推荐
     */
    @GetMapping("/recommenNovel")
    public Result<List<BookVo>> recommenNovel() {
       List<BookVo> bookVos = recService.getRecommendations();
       return Result.ok(bookVos);
    }
}
